<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.LinkedHashMap" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.io.PrintWriter" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@ page language="java" contentType="text/html; charset=UTF-8" %>


<%
    //接收当前选中周别
    String zhoubie  = request.getParameter("zhoubie");
    //查询当前周别是否需要填写月报
    String sql = "select isyb,sfqk from formtable_main_3 where id = '"+zhoubie+"'";
    String log = sql;
    rs.execute(sql);
    if(rs.next()){
        String isyb = rs.getString("isyb");
        String sfqk = rs.getString("sfqk");
        //判断是否需要填写月报
        if("1".equals(isyb)){
            //判断是否强控周123填写月报
            if("0".equals(sfqk)){//0是 1 否
                //查询当前服务器时间是否为当前选择月报的周123
                sql = "select CONVERT(varchar(100), GETDATE(), 23) as nowDate";
                rs.executeSql(sql);
                rs.next();
                String d = rs.getString("nowDate");
                //获取当前日期
                sql = "select CONVERT(varchar(100), GETDATE(), 23) as nowDate,datepart(weekday, getdate())-1 as nowWeekday,zb,isyb from formtable_main_3 where qsrq <='"+d+"' and jsrq>='"+d+"'";
                rs.executeSql(sql);
                
                //客户要求注释掉强制周一---周三填报
                <!-- if(rs.next()){
                    String nowWeekday = rs.getString("nowWeekday");
                    String is123 = ("1".equals(nowWeekday)||"2".equals(nowWeekday)||"3".equals(nowWeekday))?"true":"false";
                    if("false"==is123){
                        PrintWriter writer = response.getWriter();
                        writer.write("当前选中周别必须为周别周一周二周三提交月报");
                    }

                }else{
                    PrintWriter writer = response.getWriter();
                    writer.write("当前选中周别必须为周别周一周二周三提交月报");

                } -->

            }
        }else{
            PrintWriter writer = response.getWriter();
            writer.write("当前周别不允许填写月报！"+zhoubie);
        }
    }else{
        PrintWriter writer = response.getWriter();
        writer.write("当前周别不允许填写月报！"+zhoubie);
    }
%>